<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div><?php include "../public_flow/flow_show_info.php";?></div>

        <div class="table-box tablenes">
            <div class="title">基本信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">借证状态</td><td id="state_name" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">用途</td><td id="yong" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">使用日期</td><td id="usedt" class="tv"></td><td class="tt">预计归还日期</td><td id="yudt" class="tv"></td></tr>
                <tr><td class="tt">领取方式</td><td id="lingtype_name" class="tv"></td><td class="tt">收件信息</td><td id="shou" class="tv"></td></tr>
                <tr><td class="tt">寄件信息</td><td class="tv" id="youji" colspan="3"></td></tr>
                <tr><td class="tt">取证时间</td><td id="qudt" class="tv"></td><td class="tt">取证说明</td><td id="explain_qu" class="tv"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div class="table-box tablenes downss">
            <script type="text/html" id="toolbarDemo">证件明细</script>
            <div class="tableShow">
                <table id="datalist" lay-filter="datalist"></table>
            </div>
        </div>


        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_cert_borrow_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;


                $("#state_name").text(data.state_name);
                $("#yong").text(data.yong);
                $("#usedt").text(data.usedt);
                $("#yudt").text(data.yudt);
                $("#lingtype_name").text(data.lingtype_name);
                $("#shou").text(data.shou);
                $("#youji").text(data.youji);
                $("#qudt").text(data.qudt);
                $("#explain_qu").text(data.explain_qu);
                $("#explain").text(data.explain);



                var mytableList = table.render({
                    elem: "#datalist",data:res.data.list, toolbar: '#toolbarDemo', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',fixed:'left'}
                        ,{field: 'name', title: '证书名称'}
                        ,{field: 'major', title: '专业'}
                        ,{field: 'number', title: '证书编号'}
                        ,{field: 'form_name', title: '证书形式'}
                        ,{field: 'goes_name', title: '证书去向'}
                        ,{field: 'chanid_name', title: '所属公司'}
                        ,{field: 'guidt', title: '归还时间'}
                        ,{field: 'guiname', title: '归还备注'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });


                if(data.status == 1){
                    $(".downss .layui-table-tool-self").prepend('<div class="layui-inline" style="width:80px!important;line-height: 31px !important;"><span class="colorlan" onclick="down()">下载电子件</span></div>');
                }

                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('cert_borrow', param_id);
    });


    function down(){
        openPageEdit('down.php?close=1&id='+param_id);
    }
</script>
</body>
</html>




